import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner subject = new Scanner(System.in);
        while (subject.hasNextInt()) {
            int member = subject.nextInt();
            int count = 0;
            for (int i = 0; i < member; i++) {
                int Chinese = subject.nextInt();
                int Math = subject.nextInt();
                int English = subject.nextInt();
                int score = (Chinese + Math + English) / 3;
                if (score < 60) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
